package com.bootdo.hotel.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

import com.bootdo.hotel.dao.HotelMemberDao;
import com.bootdo.hotel.domain.HotelMember;
import com.bootdo.hotel.service.HotelMemberService;



@Service
public class HotelMemberServiceImpl implements HotelMemberService {
	@Autowired
	private HotelMemberDao hotelMemberDao;
	
	@Override
	public HotelMember get(Long id){
		return hotelMemberDao.get(id);
	}

	@Override
	public HotelMember getMemberByMobile(String mobile) {
		return hotelMemberDao.getMemberByMobile(mobile);
	}

	@Override
	public List<HotelMember> list(Map<String, Object> map){
		return hotelMemberDao.list(map);
	}
	
	@Override
	public int count(Map<String, Object> map){
		return hotelMemberDao.count(map);
	}
	
	@Override
	public int save(HotelMember hotelMember){
	
		if(hotelMember.getId() != null) {
			return hotelMemberDao.update(hotelMember);
		}else {
			return hotelMemberDao.save(hotelMember);
		}		
	
		
	}
	
	@Override
	public int update(HotelMember hotelMember){
		return hotelMemberDao.update(hotelMember);
	}
	
	@Override
	public int remove(Long id){
		return hotelMemberDao.remove(id);
	}
	
	@Override
	public int batchRemove(Long[] ids){
		return hotelMemberDao.batchRemove(ids);
	}
	
}
